package com.my.cloud.controller;

import com.my.cloud.resp.ResultData;
import com.my.cloud.service.StorageService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/3/14 11:20
 */
@RestController
@RequestMapping("/storage")
public class StorageController {
    
    @Resource
    private StorageService storageService;
    
    @PostMapping("/decrease")
    public ResultData decrease(@RequestParam("productId") Long productId, @RequestParam("count") Integer count){
        storageService.decrease(productId, count);
        return ResultData.success("扣减库存成功!!!");
    }
    
}
